<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<a href="https://github.com/AlloyTeam/omi" target="_blank" style="position: absolute; right: 0; top: 0;">
    <img src="../../asset/github.png" alt="" />
</a>
<script src="../../dist/omi.js"></script>
<script>

    var Clock =  Omi.create("Clock",{
        install:function(){
            this.data.time =  Date.now();
        },
        installed:function(){
            this.timer = setInterval(function(){
                this.data.time =  Date.now();
                this.update();
                console.log(11)
            }.bind(this), 1000);
        },
        uninstall:function(){
            clearInterval(this.timer);
        },
        render:function(){
            this.data.time = new Date(this.data.time ).toLocaleTimeString();
            return "<span>{{time}}</span>";
        }
    })

    var clock = new Clock();
    Omi.render(clock,'body',true);

    setTimeout(function(){
        clock.remove();
    },4000)
</script>
</body>
</html>